build = build/classes
executable = Simulador.jar

all:
	if [ ! -d ${build} ]; then mkdir -p ${build}; fi
	cd src; javac -d ../${build} */*.java; cp -rp images/ ../${build}
	cp Manifest.mf ${build}
	echo "Main-Class: simulador.Main" >> ${build}/Manifest.mf
	cd ${build}; jar cfm ${executable} Manifest.mf */*.class images/*
	if [ ! -d dist ]; then mkdir dist; fi
	cp ambientes dist/
	cp -rp images dist/
	cp ${build}/$(executable) dist/
run: all
	java -jar dist/Simulador.jar
tar:
	tar -cvzf simulador.tar.gz src/ doc/doc.pdf dist/ Makefile Manifest.mf README
clean:
	rm -rf dist/
	rm -rf ${build}
	mkdir -p ${build}
	mkdir dist/
